package cn.swust.designpatternlearningplatform.domain.entity;

import lombok.Data;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 试卷信息类
 *
 * @author Tang
 * @date 2023/10/16 23:11
 **/
@Data
public class TestPaperTopicContent {
    //试卷名字
    private String testName;
    //试卷编号
    private String paperNumber;
    //试卷题目id列表
    private List<Integer> topicIdList;
    //试卷总分
    private Integer totalScore;

    public void setTopicIdList(String topicIdList) {
        this.topicIdList = Arrays.stream(topicIdList.split(",")).map(Integer::valueOf).collect(Collectors.toList());
    }
}
